﻿<%@ Page Language="C#" MasterPageFile="~/LTR/MlyLtrMaster.Master" AutoEventWireup="true"
    CodeBehind="ContractoraddWoFrm.aspx.cs" Inherits="MLY.LTR.Contractors.ContractoraddWoFrm"
    Title='<%$Dict:ContractoraddWoFrm.Title%>' %>

<%@ Register Src="~/UserControls/StyledUpDown.ascx" TagName="styledUpDown" TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="title" ContentPlaceHolderID="titleHolder" runat="server">
    <title>
        <asp:Literal ID="Literal21" Text='<%$Dict:Titles.contractorAddWo%>' runat="server"></asp:Literal>
    </title>
    <style type="text/css">
        .downImage
        {
            margin-top: 5px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <center>
        <asp:Label ID="ErrMsg" runat="server" ForeColor="Red" Font-Bold="true"></asp:Label>
        <asp:Label ID="SuccessMsg" runat="server" ForeColor="Green" Font-Bold="true">
            <asp:Literal runat="server" ID="myLit" Text='<%$Dict:clientAddWo.MessageSucceeded%>'
                Visible="false"></asp:Literal>
        </asp:Label>
    </center>
    <asp:FormView ID="workOrderFrm" EnableViewState="false" runat="server" DataKeyNames="WorkOrderId"
        DataSourceID="LinqDataSource1" CssClass="blueTxtBox" DefaultMode="Insert" Width="100%"
        OnItemInserting="workOrderFrm_ItemInserting">
        <InsertItemTemplate>
            <asp:Panel ID="insertPanel" runat="server">
                <table style="width: 100%;">
                    <tr>
                        <td style="width: 175px;">
                            <asp:Literal runat="server" Text="<%$Dict:ContractorAddWoFrm.ContractorId%>" />
                        </td>
                        <td style="width: 169px;" id="win-xp">
                            <asp:DropDownList ID="ContractorIdDdl" runat="server" DataSourceID="ObjectDataSource1"
                                DataTextField="OrganizationName" DataValueField="OrganizationId" CssClass="filterDdl">
                            </asp:DropDownList>
                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="GetClientsByContractorId" TypeName="MLY.Bll.clsOrganization">
                                <SelectParameters>
                                    <asp:SessionParameter Name="ContractorId" SessionField="OrganizationId" Type="Int32" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </td>
                        <td style="width: 100px;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal1" runat="server" Text="<%$Dict:ContractorAddWoFrm.contractorWoNum%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ContractorWorkOrderNumberTextBox" runat="server" Text='<%# Bind("ContractorWorkOrderNumber") %>' />
                        </td>
                        <td>
                            <KBMValidators:requiredValidator ID="RequiredValidator1" runat="server" ControlToValidate="ContractorWorkOrderNumberTextBox"></KBMValidators:requiredValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal3" runat="server" Text="<%$Dict:ContractorAddWoFrm.CustomerWorkOrderNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="CustomerWorkOrderNumberTextBox" Enabled="false" runat="server" Text='<%# Bind("CustomerWorkOrderNumber") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal4" runat="server" Text="<%$Dict:ContractorAddWoFrm.LotNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ContractorLotNumberTextBox" runat="server" Text='<%# Bind("ContractorLotNumber") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal5" runat="server" Text="<%$Dict:ContractorAddWoFrm.SendDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="SendDateTextBox" runat="server" Text='<%# Bind("SendDate") %>' />
                        </td>
                        <td>
                            <KBMValidators:PastOnlyDateValidator ControlToValidate="SendDateTextBox" runat="server"></KBMValidators:PastOnlyDateValidator>
                            <KBMControls:KbmCalendar runat="server" TargetControlID="SendDateTextBox" defaultToToday="true"
                                ID="sendDateCalendar">
                            </KBMControls:KbmCalendar>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal6" runat="server" Text="<%$Dict:ContractorAddWoFrm.RequestedDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="RequestedDelivaryDateTextBox" runat="server" Text='<%# Bind("RequestedDelivaryDate") %>'
                                Enabled="false" />
                        </td>
                        <td>
                            <KBMValidators:BiggerThenEqualDateValidator ControlToCompare="SendDateTextBox" ControlToValidate="RequestedDelivaryDateTextBox"
                                runat="server"></KBMValidators:BiggerThenEqualDateValidator>
                            <KBMControls:KbmCalendar runat="server" TargetControlID="RequestedDelivaryDateTextBox"
                                ID="KbmCalendar1">
                            </KBMControls:KbmCalendar>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal7" runat="server" Text="<%$Dict:ContractorAddWoFrm.PlannedDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="PlannedDelivaryDateTextBox" runat="server" Text='<%# Bind("PlannedDelivaryDate") %>'
                                Enabled="true" />
                        </td>
                        <td>
                            <KBMControls:KbmCalendar runat="server" TargetControlID="PlannedDelivaryDateTextBox"
                                ID="KbmCalendar2">
                            </KBMControls:KbmCalendar>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal8" runat="server" Text="<%$Dict:ContractorAddWoFrm.ActualDelivaryDate%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ActualDelivaryDateTextBox" runat="server" Text='<%# Bind("ActualDelivaryDate") %>'
                                Enabled="true" />
                        </td>
                        <td>
                            <KBMControls:KbmCalendar runat="server" TargetControlID="ActualDelivaryDateTextBox"
                                ID="KbmCalendar3">
                            </KBMControls:KbmCalendar>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal9" runat="server" Text="<%$Dict:ContractorAddWoFrm.CustomerPriority%>" />
                        </td>
                        <td>
                            <uc:styledUpDown isRequired="true" DoubleDigit="true" runat="server" ID="StyledUpDown1"
                                Text='<%# Bind("CustomerPriority") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal10" runat="server" Text="<%$Dict:ContractorAddWoFrm.Quantity%>" />
                        </td>
                        <td>
                            <uc:styledUpDown isRequired="true" runat="server" ID="StyledUpDown2" Text='<%# Bind("Quantity") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal11" runat="server" Text="<%$Dict:ContractorAddWoFrm.CustomerCatalougeCode%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="CustomerCatalougeCodeTextBox" runat="server" Text='<%# Bind("CustomerCatalougeCode") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal17" runat="server" Text="<%$Dict:ContractorAddWoFrm.ContractorCatalougeCode%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ContractorCatalougeCode") %>' />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal12" runat="server" Text="<%$Dict:ContractorAddWoFrm.ProductDescription%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="ProductDescriptionTextBox" runat="server" Text='<%# Bind("ProductDescription") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal13" runat="server" Text="<%$Dict:ContractorAddWoFrm.TextFieldA%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextFieldATextBox" runat="server" Text='<%# Bind("TextFieldA") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    
                    <tr>
                        <td>
                            <asp:Literal ID="Literal14" runat="server" Text="<%$Dict:ContractorAddWoFrm.TextFieldB%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextFieldBTextBox" runat="server" Text='<%# Bind("TextFieldB") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    
                    <tr>
                        <td>
                            <asp:Literal ID="Literal19" runat="server" Text="<%$Dict:TextFieldC%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="TextFieldCTextBox" runat="server" Text='<%# Bind("TextFieldC") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                                        
                    <tr>
                        <td>
                            <asp:Literal ID="Literal15" runat="server" Text="<%$Dict:ContractorAddWoFrm.Remarks%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="RemarksTextBox" runat="server" Text='<%# Bind("Remarks") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal16" runat="server" Text="<%$Dict:ContractorAddWoFrm.OrderNumber%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="OrderNumberTextBox" runat="server" Text='<%# Bind("OrderNumber") %>' />
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal2" runat="server" Text="<%$Dict:ContractorAddWoFrm.DateFieldA%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtDateFieldA" runat="server" Text='<%# Bind("DateFieldA") %>' />
                        </td>
                        <td>
                            <KBMValidators:DateValidator ID="DateValidator1" ControlToValidate="txtDateFieldA"
                                runat="server" />
                            <KBMControls:KbmCalendar runat="server" TargetControlID="txtDateFieldA" 
                                ID="KbmCalendar4">
                            </KBMControls:KbmCalendar>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Literal ID="Literal18" runat="server" Text="<%$Dict:ContractorAddWoFrm.DateFieldB%>" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtDateFieldB" runat="server" Text='<%# Bind("DateFieldB") %>' />
                        </td>
                        <td>
                            <KBMValidators:DateValidator ID="DateValidator2" ControlToValidate="txtDateFieldB"
                                runat="server" />
                            <KBMControls:KbmCalendar runat="server" TargetControlID="txtDateFieldB" 
                                ID="KbmCalendar5">
                            </KBMControls:KbmCalendar>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table class="bottomBtnsCls" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td style="width: 82px;">
                            <asp:ImageButton ID="btnClose" align="middle" Width="13" Height="13" runat="server"
                                ImageUrl="~/Images/add_wo/close_icon.png" CausesValidation="false" OnClick="goBckBtn_Click" />&nbsp
                            <asp:Literal ID="Literal20" runat="server" Text='<%$Dict:clientAddWo.Close %>' />
                        </td>
                        <td>
                            <asp:ImageButton ID="btnSave" align="middle" runat="server" Width="13" Height="13"
                                ImageUrl="~/Images/add_wo/save_icon.png" CommandName="Insert" CausesValidation="true" />
                            &nbsp
                            <asp:Literal ID="Litearl1" runat="server" Text='<%$Dict:clientAddWo.Save %>' />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </InsertItemTemplate>
    </asp:FormView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" EnableInsert="true" ContextTypeName="MLY.Dal.lqKbmDataContext"
        TableName="TableWorkOrders">
    </asp:LinqDataSource>
</asp:Content>
